#ifndef DIRECTORYENTRY_H
#define DIRECTORYENTRY_H

#include <string.h>
#include <iostream>

using namespace std;

class DirectoryEntry{

 

  public:

  static const int MAX_NAME_LENGTH = 123;

  /**
   *Creates a directory entry with specified data
   *@param fileName name of the file
   *@param fcbNumber integer pointer to file control block
   */
  DirectoryEntry(char* fileName, int fcbNumber){
    strcpy(this->m_fileName, fileName);
    this->m_fcbNumber = fcbNumber;
  }

  /**
   *Mutator for fileName
   *@param fileName charactor array of new file name
   */
  void setFileName(char* fileName){
    strcpy(this->m_fileName, fileName);
  }

  /**
   *Mutator for fcbNumber
   *@param fcbNumber new fcbNumber
   */
  void setfcbNumber(int fcbNumber){
    this->m_fcbNumber = fcbNumber;
  }

  /**
   *Getter for fileName
   *@param nameBuffer empty where current name will be written to
   */
  void getFileName(char* nameBuffer){
    strcpy(nameBuffer, this->m_fileName);
  }

  /**
   *Getter for fcbNumber
   *@return integer pointer to file control block
   */
  int getfcbNumber(){
    return m_fcbNumber;
  }

  void test(){

    //test accessors
    cout<<getfcbNumber()<< endl;
    char b[123];
    getFileName(b);
    cout<< b<< endl;

    //test Mutators
    char c[123] = "file 2";
    setFileName(c);
    setfcbNumber(6);
    cout<<getfcbNumber()<< endl;
    getFileName(b);
    cout<< b<< endl;
  }

private:

  char m_fileName[MAX_NAME_LENGTH];

  int m_fcbNumber;

};

#endif
